initialize

open fun initialize(module: Module)

Initializes the control with its associated module context.

This method is typically called once before the control is first used or made active. It allows the control to set up its internal state, resources, and prepare for operation based on the provided data.

If #isAutoStart() is true, implementations might also trigger their start logic within or immediately after initialization.

Initializes the GadgetView by constructing the gadget URL from the provided com.reveldigital.player.api.Module and its options, then loads the URL.

This method parses the getOptions to determine critical parameters for the gadget URL. Key options include:

  • Source: The base URL path for the gadget.
  • CacheMode: If set to "Custom Cache", enables a custom cache interceptor.
  • UserAgent: If provided, overrides the default WebView user agent string.
  • Other options: Passed as URL parameters in the format up_OPTION_NAME=VALUE.
Special option values matching the pattern *|COMMAND[commandName]|* are resolved by looking up commandName in Commands. If found, the command's argument (getArg) replaces the placeholder; otherwise, it defaults to an empty string.

The final gadget URL is constructed using a predefined template (https://shindig.reveldigital.com/gadgets/ifr?...) and includes the resolved source, module dimensions (width and height), RegistrationKey, current language code (from LanguageCode or system default), and all processed options.

The isInitialized flag is reset to false at the start of this method and set to true in the onPageFinished callback of the WebViewClient once the URL is successfully loaded.

Parameters

module

The com.reveldigital.player.api.Module data defining the gadget to load. This updates the internal this.module reference. Must not be null.